﻿using EFFC.Frame.Net.Module.Web.Options;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace XHRPMIS
{
    public class MyWebOptions : WebMiddleWareProcessOptions
    {
    public override bool IsOpenStaticFileType(HttpContext context, string requestExtType)
    {
        if (context.Request.Path.Value.IndexOf("/wwwroot/") >= 0)
        {
            return false;
        }
        else
        {
            if (new string[] { "woff", "woff2", "tff", "svg" }.Contains(requestExtType))
            {
                return true;
            }
            else
            {
                return base.IsOpenStaticFileType(context, requestExtType);
            }
        }
    }
    public override bool IsStaticType(HttpContext context, string requestExtType)
    {
        if (new string[] { "woff", "woff2", "tff", "svg" }.Contains(requestExtType))
        {
            return true;
        }
        else
        {
            return base.IsStaticType(context, requestExtType);
        }
    }
}
}
